import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';

import qs from 'qs';

// 配置新建一个 axios 实例
const service: AxiosInstance = axios.create({
    baseURL: 'http://localhost:8080',
    timeout: 50000,
    headers: { 'Content-Type': 'application/json' },
    paramsSerializer: {
        serialize(params) {
            return qs.stringify(params, { allowDots: true });
        },
    },
});


// 导出 axios 实例
export default service;